from selenium.webdriver.common.by import By

# 页面元素枚举类
class OrgPageElement():

    # 进入通讯录界面,通讯录按钮
    mail_list_button = (By.XPATH, "//a[@class = 'navList_item_main']//span[text() = '通讯录']")
    # 点击组织架构
    org_stru_button = (By.XPATH, "//span[@class = 'navList_item_name util_tof'][text() = '组织架构']")
    # 点击+号，+号按钮
    add_button = (By.CLASS_NAME, "member_colLeft_top_addBtn")
    # 点击-添加部门，添加部门按钮
    add_org_button = (By.CLASS_NAME, "js_create_party")
    # 输入部门名称，部门输入框
    input_org_name = (By.CSS_SELECTOR, "input[name= 'name']")
    # 点击所属部门复选框，所属部门下拉框
    parent_org_box = (By.CSS_SELECTOR, "span[class = 'js_parent_party_name inputDlg_item_dropdown_title util_tof']")
    # 父部门名称不知道，想设置给谁到时候设置，三角形下拉按钮
    open_parent_org = (By.XPATH, "//div[@class='inputDlg_item']//a[text()='{}']/../i")
    # 选择所属部门，下拉框选择按钮
    choose_parent_org = (
        By.XPATH,  "//div[@class='inputDlg_item']//a[text()='{}']")
    # 点击确定，确定按钮
    define_button = (By.CSS_SELECTOR, "a[class='qui_btn ww_btn ww_btn_Blue']")
    # 选择需要修改的部门
    org_list = (By.XPATH, "//a[text()='{}']")
    # 部门设置按钮，部门名不知道，到时设置给谁就给谁
    org_set_button = (By.XPATH, "//a[text()='{}']/span")
    # 点击修改名称按钮,定位时注意修改名称按钮文本内容与部门名称按钮一致
    update_org_name_button = (By.XPATH, "//ul/li/a[text()='修改名称']")